﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinformToolkit
{
    public static class MessageBoxUtils
    {
        public static void Info(string message, params object[] param)
        {
            string msg = string.Format(message, param);
            MessageBox.Show(msg, "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static void Error(string message, params object[] param)
        {
            string msg = string.Format(message, param);
            MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static bool Confirm(string message, params object[] param)
        {
            string msg = string.Format(message, param);
            return MessageBox.Show(msg, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
        }
    }
}
